<template>
	<view class="left-window-style">
		<menu-module-left v-if="module==0"></menu-module-left>
		<menu-diy-left v-else></menu-diy-left>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapState
	} from 'vuex';
	import menuModuleLeft from './components/menu-module-left.vue';
	import menuDiyLeft from './components/menu-diy-left.vue';
	export default {
		components: {
			menuModuleLeft,
			menuDiyLeft
		},
		data() {
			return {
				PageCur: 'cur'
			}
		},
		props: {
			matchLeftWindow: {
				type: Boolean
			}
		},

		computed: {
			...mapState({
				active: state => state.active,
				module:state => state.module
			})
		},
		watch: {
			matchLeftWindow: {
				immediate: true,
				handler(newMatches) {
					this.setMatchLeftWindow(newMatches)
				}
			}
		},
		methods: {
			...mapMutations(['setMatchLeftWindow']),
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}

		}
	}
</script>

<style>
	.left-window-style {
		min-height: calc(100vh - var(--top-window-height));
		background-color: #f8f8f8;
		border-right: 1upx #CCCCCC solid;
	}

	.second-menu {
		width: 350px;
		background-color: #F8F8F8;
		height: 100vh;
	}

	.icon-image {
		width: 30px;
		height: 30px;
	}
</style>
